package com.zzcoder.mall.common.config;

import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

@Configuration
@Profile("dev")
public class PostStartupConfig implements CommandLineRunner {
    private InitializeData initializeData;

    public PostStartupConfig(
            InitializeData initializeData
    ) {
        this.initializeData = initializeData;
    }

    @Override
    public void run(String... args) throws Exception {
        initializeData.execute();
    }
}
